{#  Copyright (c) 2010-2011, Monash e-Research Centre			   #}
{#    (Monash University, Australia)					   #}
{#  Copyright (c) 2010-2011, VeRSI Consortium				   #}
{#    (Victorian eResearch Strategic Initiative, Australia)		   #}
{#  All rights reserved.						   #}
{# 									   #}
{#  Redistribution and use in source and binary forms, with or without	   #}
{#  modification, are permitted provided that the following conditions	   #}
{#  are met:								   #}
{# 									   #}
{#     * Redistributions of source code must retain the above copyright	   #}
{#       notice, this list of conditions and the following disclaimer.	   #}
{#     * Redistributions in binary form must reproduce the above	   #}
{#       copyright notice, this list of conditions and the following	   #}
{#       disclaimer in the documentation and/or other materials provided   #}
{#       with the distribution.						   #}
{#     * Neither the name of the VeRSI, the VeRSI Consortium members, nor  #}
{#       the names of its contributors may be used to endorse or promote   #}
{#       products derived from this software without specific prior	   #}
{#       written permission.						   #}
{# 									   #}
{#  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''	   #}
{#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,  #}
{#  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A		   #}
{#  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND   #}
{#  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,  #}
{#  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,	   #}
{#  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR	   #}
{#  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY	   #}
{#  OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT	   #}
{#  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE  #}
{#  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.   #}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link rel="shortcut icon" href="/site_media/favicon.ico" type="image/x-icon">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<title>MyTARDIS {% if subtitle %}- {{ subtitle }} {% endif %}</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	{% include "tardis_portal/javascript_libraries.html" %}

	{% block script %}
	{% endblock script %}

	<link href="/site_media/css/default.css" rel="stylesheet" type="text/css" media="screen">

	<script type="text/javascript">
	var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>

	<script type="text/javascript">
	try {
	var pageTracker = _gat._getTracker("UA-5443750-1");
	pageTracker._trackPageview();
	} catch(err) {}
   </script>

	<script type="text/javascript">
$(document).ready(function(){
  var users = (function () {
  var val = null;
  var authMethod = "localdb";
  var data = { authMethod: authMethod };
  $.ajax({
    'async': false,
    'global': false,
    'data': data,
    'url': '/ajax/parameter_field_list',
    'success': function (data) {
       val = data;
     }
     });
 return val;
})();
  
$("#id_q").autocomplete(users.split(" "), {
matchContains: true, multiple: true, multipleSeparator: " "
});


      });
	</script>

	      <script type="text/javascript">

		$(document).ready(function() {
			var myClose=function(hash) {
					hash.w.fadeOut('2000',function(){ hash.o.remove()});
					window.location.hash = "";
				};
			
		    // $("#fuzz").css("height", $(document).height());
		    $("#jqmAlertStatus").jqm({modal: false, overlay: 1,onHide:myClose});

			// 			    $(window).bind("resize", function() {
			// $("#fuzz").css("height", $(window).height());
			// 			    });
			
			{% if status %}
			$('#jqmAlertStatus').jqmShow();
			{% endif %}
			// $("#fuzz").fadeIn();
			if(window.location.hash) {
				if(window.location.hash == '#created')
				{
					$('#jqmStatusMessage').html('Experiment Created');
					$("#jqmAlertStatus").jqmShow();
				}
				else if(window.location.hash == '#saved')
				{
					$('#jqmStatusMessage').html('Experiment Saved');
					$("#jqmAlertStatus").jqmShow();					
				}
			}		
		});		
			
	      </script>

</head>

<body>

  <div id="header">
    <div id="logo">
      <h1><img src="/site_media/images/mytardis_logo.png"></h1>
    </div> <!-- logo -->
    <div id="menu">
      <ul>
	<li><a href="{% url tardis.tardis_portal.views.index %}">Home</a></li>
	<li><a href="{% url tardis.tardis_portal.views.about %}">About</a></li>
	<li><a href="{% url tardis.tardis_portal.views.experiment_index %}">Data</a></li>
	<li><a href="{% url tardis.tardis_portal.views.partners %}">Partners</a></li>
	<li><a href="{% url tardis.tardis_portal.views.stats %}">Stats</a></li>
      </ul>
    </div> <!-- menu -->
  </div> <!-- end header -->

  <div id="headerbg">
    <div id="headerloginstatus" style="float: left">
      {% if is_authenticated %}
        Welcome,
        {% if is_superuser %}
          <a href="{% url admin:index %}"><em>{{ username }}</em></a>
        {% else %}
          <em>{{ username }}</em>
	{% endif %}
	  - <a href="{% url django.contrib.auth.views.logout %}"> [Log Out]</a>
      {% else %}
	  <a href="{% url registration.views.register %}"> [Register] </a>
	  <a href="{% url tardis.tardis_portal.views.login %}"> [Log In]</a>
      {% endif %}
  </div> <!-- headerloginstatus -->
    {% if form %}
    <div class="searchmenu" style="float: right">
        <form method="get" action="{% url tardis.tardis_portal.views.single_search %}">
        <table>
        <tr>
            <td>
                <input type="submit" value="search"/>
            </td>
            <td>
                <input type="text" name="q" id="id_q"{% if query %} value="{{ query }}"{% endif %} />
            </td>
        </tr>
        
        </table>
        </form>
    </div> <!-- searchmenu --> 
    {% endif %}
  </div> <!-- headerbg -->

  <div id="page"> <!-- start page -->	
    <div id="content-box">
		      <div class="jqmAlertStatus" id="jqmAlertStatus">
				  <div class="jqmAlertWindowStatus">

					{% if error %}
					<div class="jqmAlertContentStatus" id="jqmAlertContentStatus"><a href="#" class="jqmClose"></a>
					  <br/>{{status}}
					
					</div> <!-- statusBoxError -->
					{% else %}
					<div class="jqmAlertContentStatus" id="jqmAlertContentStatus"><a href="#" class="jqmClose"></a>
					  <br/><span id="jqmStatusMessage">{{status}}</span>
					</div> <!-- statusBox -->
					{% endif %}
				   </div> <!-- window -->
			   </div> <!-- status -->
      {% block content %}
      {% endblock content %}

      <!-- start recent-posts -->
      <div id="recent-posts" class="sidebar">
	<div class="post">
	  {% block sidebar %}
	  {% endblock sidebar %}
	</div> <!-- post -->
      </div> <!-- recent-posts -->

      <div id="bottom" style="clear: both; width: 700px;">
	{% block bottom %}
	{% endblock bottom %}
      </div> <!-- block bottem -->

      {% block fullpage %}
      {% endblock fullpage %}

    </div> <!-- content box -->
    
    <div id="bottombar" style="padding-bottom: 5px; text-align: center;">
      Created by the <a target="_blank" style="text-decoration: underline" href="http://code.google.com/p/mytardis/">MyTARDIS Team</a> - Version 2.00
    </div> <!-- bottombar -->
  </div> <!-- page -->

</body>

</html>
